﻿/********************************************************************
* Copyright (C) 2012 iTouch, Inc (http://www.itouch.com.cn) 
* All rights reserved
* Created by ZhuDongDong <dongdong_82975389@163.com> at 2012-3-31 22:38:57

* 版权所有：浙大网新易盛网络通讯有限公司
* 文件名称：AddExpressCompany
* 作    者：朱冬冬(dongdong_82975389@163.com)
* 创建时间：2012-3-31 22:38:57
* 说    明：
*
********************************************************************
$Id: AddExpressCompany.aspx.cs 83 2012-03-31 14:49:44Z dongdong82975389@gmail.com $
$Rev: 83 $ 
$Author: dongdong82975389@gmail.com $ 
$Date: 2012-03-31 14:49:44 +0000 (Sat, 31 Mar 2012) $
*********************************************************************/

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.IO;
using IDb;
using Serialization;
using Model;
using DataDeal;

namespace OMSWeb.Admin.Systems
{
    public partial class AddExpressCompany : System.Web.UI.Page
    {
        private readonly ISerializer jsonser = SerializerFactory.GetSerializer(SerializerStyle.Json);
        //private readonly employee m_bll = new employee();
        //private DictionaryDAL _dal;
        private ExpressCompanyDal _dal; 
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                HttpRequest request = Context.Request;
                Stream stream = request.InputStream;
                string json = string.Empty;
                string responseJson = string.Empty;
                if (stream.Length != 0)
                {
                    StreamReader streamReader = new StreamReader(stream);
                    json = streamReader.ReadToEnd();
                    //employeeinfo model = jsonser.Deserialize<employeeinfo>(json);
                    //m_bll.Add(model);
                    ExpressCompany model = jsonser.Deserialize<ExpressCompany>(json);
                    _dal = new ExpressCompanyDal();
                    _dal.Save(model);
                    //_dal.Save(
                    //Context.Response.ContentType = "text/plain";
                    Context.Response.ContentType = "UTF-8";
                    Context.Response.Write("成功");
                    Context.Response.End();

                }

            }
        }
    }
}
